package java0.homework.jdbc;

import lombok.AllArgsConstructor;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;
import java.util.Map;

/**
 * 配置 Hikari 连接池 +  JdbcTemplate
 *
 * @author L.xf
 * @date 2021/10/23
 */
@AllArgsConstructor
public class MyJdbc {

    private final JdbcTemplate jdbcTemplate;


    public List<Map<String, Object>> getAll() {
        List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT id, name FROM t_student");
        return maps;
    }


}
